import api from "@/api";
import { PORT } from "../config/servicePort";

/**
 * 获取书籍列表
 */
export const getBookList = (params: any) => api.get(`${PORT}/Books/getList`, params);

// 获取书籍详情
export const getBookDetail = (params: any) => api.get(`${PORT}/Books/getInfo`, params);

// 修改书籍
export const editBook = (data?: any) => api.post(`${PORT}/Books/edit`, data);

// 删除书籍
export const deleteBook = (data?: any) => api.post(`${PORT}/Books/del`, data);

// 上下架书籍
export const updateBookStatus = (data?: any) => api.post(`${PORT}/Books/updateStatus`, data);

//新增书籍
export const addBook = (data?: any) => api.post(`${PORT}/Books/add`, data);

//*****章节相关 */
//新增书籍章节
export const addBookSection = (data?: any) => api.post(`${PORT}/BookChapters/add`, data);

//修改书籍章节
export const editBookSection = (data?: any) => api.post(`${PORT}/BookChapters/edit`, data);

//删除书籍章节
export const deleteBookSection = (data?: any) => api.post(`${PORT}/BookChapters/del`, data);

//获取书籍章节列表
export const getBookSectionList = (data?: any) => api.get(`${PORT}/BookChapters/getBookChaptersList`, data);

//获取书籍章节内容
export const getBookSectionDetail = (data?: any) => api.get(`${PORT}/BookChapters/getChaptersContent`, data);
